package edu.spec.wyn.week08.book.unit4.three;

public class Student extends Person{
    public String no;
    public double scoreOfEn;
    public double scoreOfMath;
    public double scoreOfCh;
    public double aver(){
        double aver=(scoreOfEn+scoreOfMath+scoreOfCh)/3;
        return aver;
    }
    public double max(){
        double max =scoreOfEn;
        if(scoreOfMath>max){
            max=scoreOfMath;
        }
        if(scoreOfCh>max){
            max=scoreOfCh;
        }
        return max;
    }
    public double min(){
        double min =scoreOfEn;
        if(scoreOfMath<min){
            min=scoreOfMath;
        }
        if(scoreOfCh<min){
            min=scoreOfCh;
        }
        return min;
    }
    public  String toString(){
        String s="学号："+no+"  "+super.toString()+"平均分："+aver()+"  "+"最高分："+max()+"  "+"最低分："+min();
        return s;
    }

    public static void main(String[] args) {
        Student s=new Student();
        s.no="1713580027";
        s.scoreOfCh=98.0;
        s.scoreOfMath=86.5;
        s.scoreOfEn=90.6;
        s.name="王亚男";
        s.sex='女';
        s.age=20;
        System.out.println(s.toString());
    }
}
